Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cxl-ui): cxl-base-card add lazyload for avatar image #392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pawelkmpt
Copy link

No description provided.

@pawelkmpt pawelkmpt self-assigned this Jan 30, 2024
Copy link

size-limit report 📦

Path Size
packages/cxl-ui/pkg/dist-web/cxl-ui.js 71.96 KB (+0.05% 🔺)
packages/cxl-ui/pkg/dist-web/cxl-ui-jwplayer.js 11.89 KB (0%)
packages/cxl-ui/pkg/dist-web/cxl-ui-playbooks.js 28.93 KB (0%)
packages/cxl-ui/pkg/dist-web/vendor.js 140.5 KB (0%)
packages/cxl-ui/pkg/dist-web/cxl-ui-jwplayer.js, packages/cxl-ui/pkg/dist-web/cxl-ui-playbooks.js, packages/cxl-ui/pkg/dist-web/cxl-ui.js, packages/cxl-ui/pkg/dist-web/manifest.js, packages/cxl-ui/pkg/dist-web/unresolved.js, packages/cxl-ui/pkg/dist-web/vendor.js 254.44 KB (+0.02% 🔺)

@lkraav
Copy link

lkraav commented Feb 3, 2024

Why would it ever be optional, though?

@pawelkmpt
Copy link
Author

Why would it ever be optional, though?

In situation when card is above the fold:

You should avoid setting loading=lazy for any images that are in the first visible viewport. This is particularly relevant for LCP images. See the article The performance effects of too much lazy-loading for more information.

https://web.dev/articles/browser-level-image-lazy-loading#avoid_lazy_loading_images_that_are_in_the_first_visible_viewport

@pawelkmpt pawelkmpt marked this pull request as ready for review February 6, 2024 08:53
@lkraav
Copy link

lkraav commented Feb 6, 2024

In situation when card is above the fold:

That's what I'm saying: are cards ever above the fold? Dashboard?

@@ -36,6 +36,8 @@ export class CXLBaseCardElement extends LitElement {

@property({ type: Boolean, reflect: true, attribute: 'show-time-icon' }) showTimeIcon = false;

@property({ type: Boolean }) lazyload = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps lazy or lazyLoad instead? The attribute would be lazy-load :)

@pawelkmpt
Copy link
Author

In situation when card is above the fold:

That's what I'm saying: are cards ever above the fold? Dashboard?

yes, dashboard, category pages etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants